import { AppState } from './state'

export const mutations = {
  TOGGLE_SIDEBAR: (state: AppState) => {
    state.sidebar.opened = !state.sidebar.opened
    state.sidebar.withoutAnimation = false
  },
  CLOSE_SIDEBAR: (state: AppState, withoutAnimation: boolean) => {
    state.sidebar.opened = false
    state.sidebar.withoutAnimation = withoutAnimation
  },
  TOGGLE_DEVICE: (state: AppState, device: string) => {
    state.device = device
  },
  SET_SIZE: (state: AppState, size: string) => {
    state.size = size
  },
  SET_LANGUAGE: (state: AppState, language: string) => {
    state.language = language
  }
}
